const express = require("express");
const url = require("url");
const app = express();
app.get("/info",(request,res)=>{
	// console.log(request.headers);// 请求头
	
	// http://127.0.0.1/info
	// console.log(request.url);//  /info
	
	// console.log(request.headers.host);// 127.0.0.1
	// console.log(request.hostname);// 127.0.0.1
	// console.log(request.get("host"));// 获取请求头host的值
	// console.log(request.get("connection"));// 获取请求头connection的值keep-alive
	
	// http://127.0.0.1/info
	// console.log(request.query);// {}
	
	// http://127.0.0.1/info?a=1&b=2
	// console.log(request.query);// {a:'1',b:'2'}
	// 之前
	// console.log(url.parse(request.url,true).query);
	res.end("info")
})
app.listen(80,()=>{
	console.log("success");
})